#include <stdio.h>
#include "binTree.h"
#include "queue.h"


int main() {
    // Initialize and allocate memory for tree nodes
    struct btNode* firstNode = createNode(2);
    struct btNode* secondNode = createNode(3);
    struct btNode* thirdNode = createNode(4);
    struct btNode* fourthNode = createNode(5);

    // Connect binary tree nodes
    firstNode->left = secondNode;
    firstNode->right = thirdNode;
    secondNode->left = fourthNode;

    preOrder(firstNode); printf("\n");
    inOrder(firstNode); printf("\n");
    postOrder(firstNode); printf("\n");
    levelOrder(firstNode); printf("\n");

    btNode_t *findNode = search(firstNode, 13);
    printf("%p\n", findNode);

    insert(firstNode, 6);
    printf("insert 6\n");
    preOrder(firstNode); printf("\n");
    inOrder(firstNode); printf("\n");

    delete(firstNode, 2);
    printf("delete 2\n");
    preOrder(firstNode); printf("\n");
    inOrder(firstNode); printf("\n");
    return 0;
}